<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
    <title>vanilla MVC | data inspector | object {$obj|@get_class} {$pk}</title>
    <!-- link rel="stylesheet" type="text/css" href="/~abakun/minibase/media/css/common.css" / -->
    <style type="text/css">{include file="object.css"}</style>
    <script type="text/javascript">{literal}
        var toggleCollection = function(id) {
            var x = document.getElementById(id);
            if (x) {
                x.style['display'] = x.style['display'] == 'block' ? 'none' : 'block';
            }
            return false;
        };
    {/literal}</script>
</head>
<body>

    <div class="inspector">

        <table width="100%" class="objnav"><tbody>
        <tr>
            <td class="nav" width="10%" align="left">{if $prevobjlink}<a href="{$prevobjlink}" title="{$prevobjid}">&#8656; prev</a>{/if}</td>
            <td class="cur">{$class} ({$pkcol}={$pk})</td>
            <td class="nav" width="10%" align="right">{if $nextobjlink}<a href="{$nextobjlink}" title="{$nextobjid}">next &#8658;</a>{/if}</td>
        </tr>
        </tbody></table>

        {if 0}<!--
        {* if $obj instanceof image}
            {$obj->transform('fit','100by100')}
            <div style="float: right; height: 100px; width: 100px; text-align: center;">
                <img src="{$obj->url}" />
            </div>
        {/if *} -->{/if}

        <pre class="path">{$path}</pre>

        <h2>Natural Fields <span style="font-size: .5em;">(database defined)</span></h2>
        <table class='fields' cellspacing="0" style="clear: both;">
            <thead>
                <tr><th class="first">field name</th><th>type</th><th>current value</th></tr>
            </thead>
            <tbody>
            {foreach from=$natmembers item=f}
                {$f|notefieldname}
                <!-- {capture assign=x}{$f}/{$obj->$f->id}{/capture}{$x|noteobjlink} -->
                <tr class="{cycle values="odd,even"}">
                <td class="name" valign="top">-&gt;{$f}</td>
                <td class="type" valign="top">{include file="type.tpl" v=$obj->$f}</td>
                <td class="value">{include file="value.tpl v=$obj->$f}</td>
                </tr>
            {/foreach}
            </tbody>
        </table>

        <h2 style='margin-top: 2em;'>Virtual Fields <span style="font-size: .5em;">(based on database fields)</span></h2>
        <table class='fields' cellspacing="0">
            <thead>
                <tr><th class="first">field name</th><th>type</th><th>current value</th></tr>
            </thead>
            <tbody>
            {foreach from=$virtmembers item=f}
                {$f|notefieldname}
                <!-- {capture assign=x}{$f}/{$obj->$f->id}{/capture}{$x|noteobjlink} -->
                <tr class="{cycle values="odd,even"}">
                <td class="name" valign="top">-&gt;{$f}</td>
                <td class="type" valign="top">{include file="type.tpl" v=$obj->$f}</td>
                <td class="value">{include file="value.tpl v=$obj->$f}</td>
                </tr>
            {/foreach}
            </tbody>
        </table>

        {if count($genfields)}
        <h2 style='margin-top: 2em;'>Generated Fields <span style="font-size: .5em;">(generated by code on the model)</span></h2>
        <table class='fields' cellspacing="0">
            <thead>
                <tr><th class="first">field name</th><th>type</th><th>current value</th></tr>
            </thead>
            <tbody>
            {foreach from=$genfields item=f}
                {$f|notefieldname}
                <!-- {capture assign=x}{$f}/{$obj->$f->id}{/capture}{$x|noteobjlink} -->
                <tr class="{cycle values="odd,even"}">
                    <td class="name" valign="top">-&gt;{$f}</td>
                    <td class="type" valign="top">{include file="type.tpl" v=$obj->$f}</td>
                    <td class="value">{include file="value.tpl v=$obj->$f}</td>
                </tr>
            {/foreach}
            </tbody>
        </table>
        {/if}
    </div>

</body>

</html>
